Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Rename transform #15

Merged
merged 16 commits into from
Nov 23, 2021
Merged

Implement Rename transform #15

merged 16 commits into from
Nov 23, 2021

Conversation

Omar-Elrefaei
Copy link
Contributor

@Omar-Elrefaei Omar-Elrefaei commented Nov 14, 2021

This should be fully functional, but I think the usage of push!! will need to be redesigned to be more functional and efficient like other transforms. That is the place where I think I need a little help: I am not sure how to make it so that I don't need push!! and use 𝒯 = (; zip(anames, acols)...) instead like the rest of the of the transforms.

Copy link
Member

@juliohm juliohm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attached a first round of reviews.

src/TableTransforms.jl Outdated Show resolved Hide resolved
src/TableTransforms.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
@Omar-Elrefaei
Copy link
Contributor Author

Ooof, my bad for half of these things. I guess that what you get from sending a PR of after-midnight code without a review. I will fix the formatting and naming right away, but that I am not 100% sure about is how to phase out push!! ?

@Omar-Elrefaei
Copy link
Contributor Author

Is it as simple as looping through the results of Tables.columnnames(table), replacing the names that need to be renamed, and then (; zip(names, cols)...) ??

@juliohm
Copy link
Member

juliohm commented Nov 14, 2021

Exactly, you can write it in a single:

newcols = map(cols) do col
  # do the renaming
end

See the other transforms for examples.

@Omar-Elrefaei
Copy link
Contributor Author

I'm sorry, I screwed up git a bit. I'll comment when it's ready for review.

@Omar-Elrefaei
Copy link
Contributor Author

I believe its ready for another review.

Copy link
Member

@juliohm juliohm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review attached.

src/transforms/rename.jl Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
@juliohm
Copy link
Member

juliohm commented Nov 18, 2021

@Omar-Elrefaei did you have time to update this PR?

@Omar-Elrefaei
Copy link
Contributor Author

Omar-Elrefaei commented Nov 18, 2021 via email

@juliohm
Copy link
Member

juliohm commented Nov 19, 2021

@Omar-Elrefaei you mean that this PR should be closed?

@Omar-Elrefaei
Copy link
Contributor Author

@Omar-Elrefaei you mean that this PR should be closed?

No, if not today after my dayjob, I'll definitely be sending updates in the weekend.

@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2021

Codecov Report

Merging #15 (b72f999) into master (8547acf) will increase coverage by 3.28%.
The diff coverage is 100.00%.

❗ Current head b72f999 differs from pull request most recent head 8c330eb. Consider uploading reports for the commit 8c330eb to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage   88.16%   91.44%   +3.28%     
==========================================
  Files          13       14       +1     
  Lines         321      339      +18     
==========================================
+ Hits          283      310      +27     
+ Misses         38       29       -9     
Impacted Files Coverage Δ
src/transforms.jl 97.82% <100.00%> (+2.17%) ⬆️
src/transforms/rename.jl 100.00% <100.00%> (ø)
src/transforms/sequential.jl 92.59% <100.00%> (+29.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6d67c9...8c330eb. Read the comment docs.

@Omar-Elrefaei Omar-Elrefaei marked this pull request as ready for review November 22, 2021 05:23
@Omar-Elrefaei Omar-Elrefaei marked this pull request as draft November 22, 2021 05:24
@Omar-Elrefaei
Copy link
Contributor Author

Omar-Elrefaei commented Nov 22, 2021

I think it's ready for another review.
I have:

  • added the assert
  • added tests
  • refactored _rename out
  • made the varargs constructor
  • not used cache for anything

src/transforms/rename.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
src/transforms/rename.jl Outdated Show resolved Hide resolved
@juliohm juliohm marked this pull request as ready for review November 23, 2021 17:45
src/transforms/rename.jl Outdated Show resolved Hide resolved
@juliohm
Copy link
Member

juliohm commented Nov 23, 2021

Awesome improvements @Omar-Elrefaei , I am merging it.

The test that is failing is unrelated. For some reason one of our visual tests is failing randomly. Do you think you can take a look at this issue? Maybe we are missing some Random.seed! call somewhere?

@juliohm juliohm merged commit 97e2d77 into JuliaML:master Nov 23, 2021
@Omar-Elrefaei
Copy link
Contributor Author

Omar-Elrefaei commented Nov 23, 2021

Great!
Thank you very much @juliohm for the patient and valuable feedback.

I'll open an issue so that not to forget to investigate the failing tests.
Looking forward to my next PR 😃

@Omar-Elrefaei Omar-Elrefaei changed the title wip: implement Rename transform Implement Rename transform Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants